import createReq from "../request";
import { Method } from "../type";
import { type ILabInfo, ILabQuery } from "../RequestIDL/labManage";
// 实验室分页查询
export const queryBatchLap = (data: ILabQuery) => {
  return createReq({
    method: Method.POST,
    url: "/lab/searchByConditionPage",
    data,
  });
};
// 删除实验室
export const deleteLabById = (data: Partial<ILabInfo>) => {
  return createReq({
    method: Method.POST,
    url: "/lab/delete",
    data,
  });
};
// 新增实验室
export const createLab = (data: Partial<ILabInfo>) => {
  return createReq({
    method: Method.POST,
    url: "/lab/add",
    data,
  });
};
// 更新实验室
export const updateLab = (data: Partial<ILabInfo>) => {
  return createReq({
    method: Method.POST,
    url: "/lab/update",
    data,
  });
};
// 实验室类型 获取
export const getAllLabType = () => {
  return createReq({ method: Method.GET, url: "labtype/all" });
};
// 根据id获取
export const getLabById = (data: { id: number }) => {
  return createReq({ method: Method.POST, url: "/lab/getById", data });
};
